import { close, connect } from "../../util/mongo"
export default defineEventHandler(async (event) => {
   const {db,client} = await connect()
        const collection = db.collection('purchase')
        const data = await readBody(event)
        console.log('purchase:' ,data)
       
        await collection.insertOne(data)
        close(client)
})
